package org.ricks.common.conf;

/**
 * @author chenwei
 * @Title:
 * @Package
 * @Description:
 * @date 2020/12/1720:07
 */
@ConfProperties(prefix = "network.")
public class NetWorkConfig {

    //服务端
    private static int port = 8888;
    private static int idleTime = 300;
    private static int threads = Runtime.getRuntime().availableProcessors() * 2;
    private static boolean traffic = false;
    private static boolean fixed = true;

    //客户端
    private static short heartBeatCmd = 0;//客户端心跳 指令
    private static long clientHeartBeatTime = 30000;//客户端心跳 时间 ms

    public static int getPort() {
        return port;
    }

    public static void setPort(int port) {
        NetWorkConfig.port = port;
    }

    public static int getIdleTime() {
        return idleTime;
    }

    public static void setIdleTime(int idleTime) {
        NetWorkConfig.idleTime = idleTime;
    }

    public static int getThreads() {
        return threads;
    }

    public static void setThreads(int threads) {
        NetWorkConfig.threads = threads;
    }

    public static short getHeartBeatCmd() {
        return heartBeatCmd;
    }

    public static void setHeartBeatCmd(short heartBeatCmd) {
        NetWorkConfig.heartBeatCmd = heartBeatCmd;
    }

    public static long getClientHeartBeatTime() {
        return clientHeartBeatTime;
    }

    public static void setClientHeartBeatTime(long clientHeartBeatTime) {
        NetWorkConfig.clientHeartBeatTime = clientHeartBeatTime;
    }

    public static boolean isTraffic() {
        return traffic;
    }

    public static void setTraffic(boolean traffic) {
        NetWorkConfig.traffic = traffic;
    }

    public static boolean isFixed() {
        return fixed;
    }

    public static void setFixed(boolean fixed) {
        NetWorkConfig.fixed = fixed;
    }
}
